from wcs.libs.races import *
from wcs.libs.races.base import *
from wcs.libs.constants import *
from wcs.libs.keygroups import *

__all__ = ["KeyGroupRace"]

class KeyGroupRace(RaceBase):
    """
    This object represents an old style keygroup race. Each instance should
    represent it's own keygroup race from the ../wcs/race_folder/ folder in the
    format of ../wcs/race_folder/<racename>/es_<racename>_db.txt
    """
    def __init__(self, raceName):
        races[raceName] = self
        RaceBase.__init__(self, raceName, self.__class__)
        self.keyGroupPath = RACE_PATH.joinpath("es_%s_db.txt" % raceName)
        self.keyGroup = wcskeygroupparser.keyGroupLoad(self.keyGroupPath)